package com.xinchen.aiodispose.model

import com.xinchen.aiodispose.model.api.ApiService
import com.xinchen.aiodispose.model.interceptor.HeaderInterceptor
import com.xinchen.aiodispose.model.interceptor.URLInterceptor
import com.maple.utils.network.BaseRetrofitClient
import com.maple.utils.util.HttpRequestUtils
import com.xinchen.aiodispose.app.Config
import okhttp3.OkHttpClient

object RetrofitClient: BaseRetrofitClient() {

    val service by lazy { getService(ApiService::class.java, Config.getBaseURL()) }

    override fun handleBuilder(builder: OkHttpClient.Builder) {
        builder.addInterceptor(URLInterceptor())
        builder.addInterceptor(HeaderInterceptor(HttpRequestUtils.requestHeader(Config.getAppName())))
    }


}